home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Mac OS USB DDK / Examples / USBSampleStorageDriver / SampleStorageDriverAPI.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-12  |  1.9 KB  |  95 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SampleStorageDriverAPI.c
  3.  
  4.     Contains:    Sample Storage Class functions used by the Storage Class UT Driver
  5.  
  6.     Version:    1.1
  7.  
  8.     Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                Craig Keithley
  13.  
  14.         Other Contact:        xxx put other contact here xxx
  15.  
  16.         Technology:            USB Drivers
  17.  
  18.     Writers:
  19.  
  20.         (CJK)    Craig Keithley
  21.  
  22.     Change History (most recent first):
  23.  
  24.       <USB2>     1/11/99    CJK        update to use sources from 1.1f3 DDK
  25.  
  26.  
  27. */
  28.  
  29.  
  30.  
  31. #include <Errors.h>
  32. #include "SampleStorageDriverAPI.h"
  33.  
  34. // Prototypes for the functions in the dispatch table for the Unit Table Driver
  35. EXTERN_API_C( OSStatus )
  36. StorageInitialize            (void);
  37.  
  38. EXTERN_API_C( OSStatus )
  39. StorageControl                (UInt32 theControlSelector, void *theControlData);
  40.  
  41. EXTERN_API_C( OSStatus )
  42. StorageStatus                (UInt32 theInfoSelector, void *theInfo);
  43.  
  44. EXTERN_API_C( OSStatus )
  45. StorageExecuteCommand        (StorageExecuteCommandPBPtr storageExecuteCommandPBPtr );
  46.  
  47.  
  48. OSStatus StorageInitialize(void)
  49. {
  50. OSStatus    status;
  51.  
  52.     status = StorageClassDriverInitialize();
  53.     
  54.     return status;
  55. }
  56.  
  57. OSStatus StorageControl(UInt32 theControlSelector, void * theControlData)
  58. {
  59. OSStatus    status;
  60.  
  61.     status = StorageClassDriverControl(theControlSelector, theControlData);
  62.  
  63.     return status;
  64. }
  65.  
  66. OSStatus StorageStatus(UInt32 theInfoSelector, void *theInfo)
  67. {
  68. #pragma unused (theInfoSelector, theInfo)
  69. OSStatus    status;
  70.  
  71.     status = StorageClassDriverStatus(theInfoSelector, theInfo);
  72.  
  73.     return status;
  74. }
  75.  
  76. OSStatus StorageExecuteCommand(StorageExecuteCommandPBPtr storageExecuteCommandPBPtr)
  77. {
  78. OSStatus    status;
  79.  
  80.     status = StorageClassDriverExecuteCommand(storageExecuteCommandPBPtr);
  81.     
  82.     return status;
  83. }
  84.  
  85.  
  86.  
  87. StorageClassDispatchTable TheStorageClassDispatchTable =
  88. {
  89.     (UInt32)                        kDispatchTableVersion,
  90.     (StorageInitializeProcPtr)        StorageInitialize,
  91.     (StorageControlProcPtr)            StorageControl,
  92.     (StorageStatusProcPtr)            StorageStatus,
  93.     (StorageExecuteCommandProcPtr)    StorageExecuteCommand
  94. };
  95.